home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / LANG / C / LIB / DESK / CORE / Desk / h_doc / ColourTran < prev    next >
Text File  |  1996-06-25  |  3KB  |  109 lines

  1. /*
  2.     ####             #    #     # #
  3.     #   #            #    #       #          The FreeWare C library for 
  4.     #   #  ##   ###  #  # #     # ###             RISC OS machines
  5.     #   # #  # #     # #  #     # #  #   ___________________________________
  6.     #   # ####  ###  ##   #     # #  #                                      
  7.     #   # #        # # #  #     # #  #    Please refer to the accompanying
  8.     ####   ### ####  #  # ##### # ###    documentation for conditions of use
  9.     ________________________________________________________________________
  10.  
  11.     File:    ColourTran.h
  12.     Author:  Copyright © 1993 Shaun Blackmore, Brian Scattergood
  13.     Version: 1.02 (05 Nov 1995)
  14.     Purpose: Function veneer for ColourTrans SWIs
  15.     History: 1.00 (13 May 1994) SB
  16.              1.01 (31 Oct 1995) BS Added Desk_ColourTrans_ReturnColourNumber and
  17.                                          Desk_ColourTrans_ReturnGCOL
  18.              1.02 (05 Nov 1995) JS Added macros Desk_ColourTrans_RGB, 
  19.                                    Desk_ColourTrans_SetGCOL2, Desk_ColourTrans_SetGCOL3.
  20. */
  21.  
  22.  
  23.  
  24. #ifndef __Desk_ColourTran_h
  25. #define __Desk_ColourTran_h
  26.  
  27. #ifdef __cplusplus
  28.     extern "C" {
  29. #endif
  30.  
  31.  
  32. #ifndef __Desk_Core_h
  33. #include "Core.h"
  34. #endif
  35.  
  36. extern void    Desk_ColourTrans_SetGCOL( int palette, int flag, int gcolaction);
  37. /*
  38. palette:    A RGB word (See Desk_ColourTrans_RGB).
  39.  
  40. flag:        Bit 7 is: 0-foreground, 1-background.
  41.         Bit 8 is: 1-use ECFs, 0-don't use ECFs  (under RISC OS 2,
  42.         ECFs are never used.
  43.         The remaining bits are unused.
  44.  
  45. gcolaction:    GCOL action - see Desk_gfx_action_* etc.
  46.         To set normal overwriting colour, use
  47.         Desk_gfx_action_OVERWRITE (which is 0).
  48.  */
  49.  
  50.  
  51. #define Desk_ColourTrans_RGB( r, g, b)    \
  52.     ( ( (unsigned)(r)<<8 | (unsigned)(g)<<16 | (unsigned)(b)<<24))
  53. /*
  54. This generates a RGB word for use with ColourTrans calls, from three
  55. 0-255 values.
  56.  */
  57.  
  58.  
  59. #define    Desk_ColourTrans_SetGCOL2( palette)    \
  60.     Desk_ColourTrans_SetGCOL( palette, 1<<8, 0)
  61. /*
  62. Simple macro for setting colour to a palette value
  63.  */
  64.  
  65. #define Desk_ColourTrans_SetGCOL3( r, g, b)    \
  66.     Desk_ColourTrans_SetGCOL2( Desk_ColourTrans_RGB( r, g, b))
  67. /*
  68. Simple macro for setting colour to a RGB value
  69.  */
  70.  
  71.  
  72.  
  73. extern void    Desk_ColourTrans_InvalidateCache(void);
  74.  
  75. extern void    Desk_ColourTrans_SelectTable(int Desk_src_mode, int *Desk_src_pal,
  76.                                   int Desk_dst_mode, int *Desk_dst_pal,
  77.                                   char *table);
  78.  
  79. typedef struct
  80. {
  81.   int font;
  82.   int back;
  83.   int fore;
  84.   int max;
  85. } Desk_colourtrans_fontblock;
  86.  
  87. extern void    Desk_ColourTrans_ReturnFontColours(Desk_colourtrans_fontblock *fontcols);
  88.  
  89.  
  90. extern int Desk_ColourTrans_ReturnColourNumberForMode(int palette, int mode,
  91.                                                  int *pal);
  92. /*
  93. Returns colour number.
  94. */
  95.  
  96.  
  97. extern int    Desk_ColourTrans_ReturnColourNumber(int entry);
  98.  
  99. extern int    Desk_ColourTrans_ReturnGCOL(int entry);
  100.  
  101.  
  102.  
  103. #ifdef __cplusplus
  104. }
  105. #endif
  106.  
  107.  
  108. #endif
  109.